

public class PeerInfo
{
	
	//Object Properties
	private int peerID;
	private String hostname;
	private int listeningPort;
	private boolean hasFile;
	
	//Constructor with all the properties as inputs
	public PeerInfo(int peerID, String hostname, int listeningPort, boolean hasFile)
	{
		this.peerID = peerID;
		this.hostname = hostname;
		this.listeningPort = listeningPort;
		this.hasFile = hasFile;
	}
	
	//Constructor with all the properties as inputs
	public PeerInfo(String peerID, String hostname, String listeningPort)
	{
		this.peerID = Integer.parseInt(peerID);
		this.hostname = hostname;
		this.listeningPort = Integer.parseInt(listeningPort);
	}
	
	//returns the peerID
	public int getPeerID()
	{
		return this.peerID;
	}
	
	//returns hostname
	public String getHostname()
	{
		return this.hostname;
	}
	
	//returns listeningPort
	public int getListeningPort()
	{
		return this.listeningPort;
	}
	
	//returns hasFile
	public boolean getHasFile()
	{
		return this.hasFile;
	}
	
	public String toString()
	{
		
		return "ID: " + this.peerID + " HostName: " + this.hostname + " Listening Port: " + this.listeningPort + " has File?: " + this.hasFile;
	}
}

